The present invention relates generally to a system and method for coding and/or decoding an image including a bit-map of different levels. More specifically, the invention relates to an image coding and/or decoding system and method which discriminates as to whether the digital value of a block configuring an image data is a small-level, or a multilevel containing 256-tones, for coding the block in accordance with its digital value, and which decodes the coded image including a bit-map of different levels for reproduction, display, and so forth. Throughout the specification, "small bit-map data" refers a binary, a three-level, four-level and six-level with respect to bit-map data.
The small bit-map data of binaries or four-levels are bit-map data regarding resolution to be more important than tone, and the multilevel bit-map data are bit-map data regarding tone to be more important than resolution.
As desktop publishing (DTP) has been developed, it has been easy to add a natural image such as a photograph to a document, and there have been great opportunities for recording a natural image. Therefore, it is expected to develop an image recording system such as a printer for printing and recording an image which includes a character Image and a natural image. The digital values of a natural image often have multilevel data of multitone, not binary data for white and black such am a character image.
In an image recording system such as most of conventional printers and digital copying machines, the aforementioned binary data is recorded by the pseudo half-tone recording method. In this method, a pseudo half-tons is expressed in accordance with the ratio of white picture elements to black picture elements in a certain small region (block) The reason why this pseudo half-tone recording method is proposed is that conventional image recording systems are suitable for a binary recording which records an image in accordance with the presence of a bit, and that they are unsuitable for a multilevel recording which expresses the density of multilevel by individual dots. However, in a recent image recording system such as a laser printer, it is possible to carry out the multilevel recording by the pulse-width modulation and the intensity modulation in a picture elemnt, since the processing speed of a controller increases as the performance of a laser drive or a CPU increases.
In a picture image recording system such as a printer, it is designed that the image data to be recorded are temporarily stored in an image memory such as a page memory, and that the stored image date are read out to be supplied for recording. In a multilevel data recording system, it is necessary for a page memory to have large capacity since data for one picture element are multilevel data. That is, the capacity of the memory per one picture element must be the bit-number times as large as the capacity of a page mammary for a binary data recording system wherein 1-bit information is stored as the data for one picture element. As a result, there is a problem in that the manufacturing cost of the whole recording system is increased.
Therefore, the technique for compressing the data of large capacity of the different-levels bit-map data using the compression technique to write the reduced measure of information in a memory of limited capacity, has been proposed. As a general method for this technique, there is a method for recording binary data as they are, and for compressing only multilevel data to write them in a memory. For example, in Japanese Patent Laid-Open No. 6-40661, when image data are written every block composed of a plurality of picture elements, it is discriminated as to whether the data in each of the blocks are binary data or multilevel data. Then, the binary data are stored in a memory without the need of compression, and the multilevel data are compressed up to substantially the same measure of information as that of binary data in accordance with the average value of data of the picture elements in the block, so that the capacity of a page memory necessary for storing the data can be saved.
In addition, as the prior art used for a conventional system for recording an image including a bit-map of different levels, a fixed-length compression technique for compressing image data into a fixed-length code having a predetermined bit-number is proposed in "Image Compression Suitable For Hard Copy System" (written by Oka, Aniin and Nakajima, Journal of Japan Society of Printing, Vol. 27, No. 3, pp. 290-298, 1990).
In this compression method, an original image of picture elements, each of which is a 8-bit picture element, is blocked into a plurality of blocks, each being composed of 4.times.4 picture elements. Then, each of the blocks is divided so that the difference between the maximum value and the minimum value in the 16 picture elements in each of the blocks is 2 bits. That is, each of the blocks is divided into four levels including the maximum value and the minimum value so that the value of each of the 16 picture elements is approximated by the four levels. The code amount of each of the block is 32 bits since "2 (bits).times.16 (picture elements)". In addition, 8 bits are assigned to each of the maximum value and the minimum value, and are added to 32 bits of the coded image. The 48 bits thus totaled are compressed and coded to be used as image data for each of the blocks.
According to the aforementioned conventional system for recording an image including a bit-map of different values, it is possible to compress the measure of information of multilevel data up to the same measure as that of binary data by means of blocking. However, since it is discriminated as to whether the date configuring the respective blocks are binary data or multilevel data, there is a disadvantage in that discriminating data of 1 bit must be newly written in a memory as additional data. Therefore, it is required to provide a memory of capacity at least two time as large an the capacity of a page memory for storing multilevel data. Considering an aspect of cost, it is desired to reduce the capacity of a page memory for storing multilevel data up to the same measure as the capacity of a page memory for storing binary data.
In addition, according to the aforementioned system of the fixed-length compression to which a compression method using 4-level digital values in each block is applied, the amount for compressed data is 48 bits per 16 picture elements, i.e. 3 bits per a picture element. Therefore, although there is an advantage in that the coding can be carried out using a fixed-length code, there is a disadvantage in that the amount of compressed data is greater then that in the variable-length coding method such as a method by Telecommunication Standardization Department of International Telecommunication Union (Joint Photographic coding Experts Group (JPEG)).